---
description: "Reference for Nitric's Dart library - Returns the connection string for a SQL database at runtime."
---

# Dart - sql.connectionString()

<Note>
  This is reference documentation for the Nitric Dart SDK. To learn about SQL
  Databases in Nitric start with the [SQL docs](/sql).
</Note>

Returns the connection string for a SQL database at runtime.

```dart
import 'package:nitric_sdk/nitric.dart';

final db = Nitric.sql("my-database");

// Should be called at runtime, such as in a service handler
final connStr = await db.connectionString();
```

## Examples

### Return a connection string

```dart
import 'package:nitric_sdk/nitric.dart';

final db = Nitric.sql("my-database");

// Should be called at runtime, such as in a service handler
final connStr = await db.connectionString();
```
